Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@embroider/addon-shim

Package Overview
Dependencies
Maintainers
0
Versions
370
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@embroider/addon-shim

Make v2 addons work in non-Embroider apps.

  • 1.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
123K
decreased by-0.44%
Maintainers
0
Weekly downloads
 
Created
Source

@embroider/addon-shim

Makes a v2 addon work like a v1 addon so it can be used in a classic (non-Embroider) app.

This allows addons to update to v2 without waiting for all their users to upgrade to Embroider.

Compatibility

  • Ember.js v3.13 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Installation

ember install @embroider/addon-shim

Usage

To use it:

  1. Be prepared to do a semver major release of your addon, because the shim demands that the app has ember-auto-import >= 2.

  2. Create an addon-main.js file that requires and invokes the shim:

    const { addonV1Shim } = require('@embroider/addon-shim');
    module.exports = addonV1Shim(__dirname);
    
  3. Update your package.json to point at addon-main.js:

    {
      "ember-addon": {
        "version": 2,
        "type": "addon",
        "main": "addon-main.js"
      }
    }
    

Shim Options

disabled: this optional argument lets you control whether your shimmed addon will emit 'app-js' and 'public-assets' into non-embroider builds. Example:

module.exports = addonV1Shim(__dirname, {
  disabled(options) {
    let welcomeConfig = options['ember-welcome-page'] || {};
    return process.env.EMBER_ENV === 'production' && !welcomeConfig.enabled;
  },
});

This option only works in non-embroider builds. Under embroider, apps just won't import the parts of your addon they don't want.

Contributing

See the top-level CONTRIBUTING.md in this monorepo.

License

This project is licensed under the MIT License.

FAQs

Package last updated on 31 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc